package com.rui.study.commons.model;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class BizException extends RuntimeException {

    private String status;

    public BizException(GlobalStatus globalStatus) {
        super(globalStatus.getMessage());
        this.status = globalStatus.getStatus();
    }

    public BizException(GlobalStatus globalStatus, String... args) {
        super(String.format(globalStatus.getMessage(), args));
        this.status = globalStatus.getStatus();
    }

    public BizException(String status, String message) {
        super(message);
        this.status = status;
    }
}
